package net.example.model.common;

public enum ChatInfoType{
    Person(0),
    Group(1),
    System(2);

    private int type;

    ChatInfoType(int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public static ChatInfoType getChatInfoType(int code) {
        for (ChatInfoType type : ChatInfoType.values()) {
            if (type.getType() == code) {
                return type;
            }
        }
        return null;
    }

}
